<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use App\Services\BusinessService;//需要注入的服务的路径
class BusinessServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        //使用singleton绑定单例,其中test名字适用于绑定的别名
        $this->app->singleton('business',function(){
            return new BusinessService();
        });
    }
}
